Skip to content

mkimage: fit: check cmd string for buffer overflow #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 4, 2016
Merged

mkimage: fit: check cmd string for buffer overflow #11

merged 1 commit into from
Nov 4, 2016

Conversation

Ham22
Copy link
Member

@Ham22 Ham22 commented Nov 4, 2016

When generating the command to create the fit image the inputs are
file paths which can overflow the buffer. snprintf was being used to
avoid the overflow itself but nothing actually checks if a
truncation occured giving unexpected filenames causing following
stages to fail.

Therefore add some checks before attempting to run the command.

Additionally have bumped up the size of the buffer as the current
inputs can easily get truncated with long paths.

Signed-off-by: Ian Pozella [email protected]

When generating the command to create the fit image the inputs are
file paths which can overflow the buffer. snprintf was being used to
avoid the overflow itself but nothing actually checks if a
truncation occured giving unexpected filenames causing following
stages to fail.

Therefore add some checks before attempting to run the command.

Additionally have bumped up the size of the buffer as the current
inputs can easily get truncated with long paths.

Signed-off-by: Ian Pozella <[email protected]>
@Ham22 Ham22 added the s: review label Nov 4, 2016
@Shpinkso Shpinkso merged commit 64e4021 into CreatorDev:2015.10 Nov 4, 2016
@Shpinkso Shpinkso removed the s: review label Nov 4, 2016
@Ham22 Ham22 deleted the mkimage branch November 4, 2016 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants